<% content_for :sitemap do %>
  <span class="current"><%= t('admin.menu.comments') %></span>
<% end %>
<table class='table table-bordered table-striped table-condensed'>
  <tr>
    <th style="width:100px">Target</th>
    <th><%= t("common.creator") %></th>
    <th>Body</th>
    <th>Time</td>
    <th></td>
  </tr>
  <% @comments.each do |item| %>
    <tr id="comment<%= item.id %>">
      <td><%= item.commentable_type %>#<%= item.commentable_id %></td>
      <td><%= item.user.login if !item.user.blank? %></td>
      <td><%= item.body %></td>
      <td><%= l item.created_at, format: :short %></td>
      <td class="actions">
        <div class="btn-group">
          <%= link_to icon_tag("edit"), edit_admin_comment_path(item), class: "btn" %>
          <%= link_to icon_tag("trash"), admin_comment_path(item), 'data-confirm' => 'Are you sure?', method: :delete, remote: true, class: "btn" %>
        </div>
      </td>
    </tr>
  <% end %>
</table>
<%= paginate @comments %>
